home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BCI NET
/
BCI NET Dec 94.iso
/
archives
/
programming
/
blitzbasic
/
riblitzlibs.lha
/
riblitzlibs
/
gfx
/
GFXTest.asc
< prev
Wrap
Text File
|
2002-02-02
|
1KB
|
79 lines
;GFX library (C)1994 Reflective Images
;Example program
;By Stephen McNamara
;Please feel free to use any part of the program
; in whatever way you feel like
;Open a screen
Screen 0,0,0,320,200,5,0,"GFX-Library Example Program",2,1
;Set up our palette with some dummy colours
For h.l=0 To 15
PalRGB 0,h,h,h,h
PalRGB 0,h+16,h,h,0
Next h
;But keep our screens default colours
For h=0 To 3
PalRGB 0,h,Red(h),Green(h),Blue(h)
Next h
;Get a bitmap to use from the screen
ScreensBitMap 0,0
Use BitMap 0
BitMapOutput 0
;And draw some rubbish
y=12
For h=1 To 31
Boxf 0,y,319,y+4,h
y+5
Next h
;Use our palette on the screen
Use Palette 0
;And make our library use the palette
PaletteInfo 0
Locate 0,23 : NPrint "Values :"
Locate 0,24 : NPrint "AGA values:"
;Loop until you press the mouse button
Repeat
VWait
;get our mouse coordinates
xm.w=SMouseX
ym.w=SMouseY
;get the colour under the mouse pointer
cl.w=Point(xm,ym)
;Print our colour values
Locate 12,23
Print "R:"+Str$(PalRed(cl))+" G:"+Str$(PalGreen(cl))+" B:"+Str$(PalBlue(cl))+" "
Locate 12,24
Print "R:"+Str$(AGAPalRed(cl))+" G:"+Str$(AGAPalGreen(cl))+" B:"+Str$(AGAPalBlue(cl))+" "
Until Joyb(0)
;Do a nice palette fade using palettes 0 and 1
;Set up palette 1 to have 32 colours
PalRGB 1,31,0,0,0
;DO the fade!
For ratio.q=1 To 0 Step -0.01
PalAdjust 1,ratio
Use Palette 1
VWait
Next ratio
VWait 25
End